home *** CD-ROM | disk | FTP | other *** search
- Date: Mon, 20 Jun 94 17:09:54 +0200
- From: thuerman@ibr.cs.tu-bs.de (Urs Thuermann)
- Message-Id: <9406201509.AA23990@eos>
- To: itschere@techfak.uni-bielefeld.de
- In-Reply-To: itschere@TechFak.Uni-Bielefeld.DE's message of Mon, 20 Jun 94 12:00:26 MET DST <9406201000.AA10268@rubin.techfak.uni-bielefeld.de>
- Subject: bug in mintlib44's access() function
-
- > So if this function
- > tells me I can access a file, it will be true.
-
- No. Not even that. If access() returns 0, it tells you you would have
- access, if your effective id was equal to your real id, i.e. if you
- execute another user's setuid program you may not have access to your
- own files (if that user doesn't have), although access() returns 0
- because it checks your real uid.
-
- > But the negation of that
- > mustn't necessarily also be true: If this function tells me I'm *not*
- > allowed to access a file, I *may* in fact perhaps be allowed to, and thus,
- > there's no point in calling this functions in the first place. Just open
- > the file and see if it works...
-
- This function is useful if don't want a user to have access to files
- through execution of setuid programs, that he otherwise couldn't
- access. In that case, you check if he should be granted access by
- calling access() just before you open the file.
-
- If you want to know if you really have access to a file, just try to
- open it and check the return code.
-
- Urs
-